#ifndef __RECODERMANAGER_H_
#define __RECODERMANAGER_H_

#include "j_includes.h"
#include "x_singleton.h"

class CRecoderManagerBase : public J_AsioUser
{};

class CRecoderManager : public SingletonTmpl<CRecoderManagerBase>
{
public:
    CRecoderManager();
    ~CRecoderManager();
public:
    ///J_AsioUser
	virtual int OnAccept(int nfd) { return J_OK; }
	virtual int OnRead(int nfd) { return J_OK; }
	virtual int OnWrite(int nfd);
	virtual int OnBroken(int nfd) { return J_OK;}

    ///CRecoderManager
    int StartService();
    int StopService();
    int StartRecode(const char *pResid);
    int StopRecode(const char *pResid);

private:
    typedef std::map<std::string, J_MediaObj *> MediaMap;
    typedef std::map<int, std::string> Fdmap;
    MediaMap m_mediaMap;
    Fdmap m_fdMap;
    int m_fds;
};

#endif //~__RECODERMANAGER_H_
